<?php
/**
 * Zend Framework (http://framework.zend.com/)
 *
 * @link      http://github.com/zendframework/ZendSkeletonApplication for the canonical source repository
 * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
 * @license   http://framework.zend.com/license/new-bsd New BSD License
 */

return array(
    // Custom settings
    'application' => array(
        'file_path' => '/uploads/',
        'full_file_path' => $_SERVER['DOCUMENT_ROOT'].'/uploads/',
    ),
    'router' => array(
        'routes' => array(
            'home' => array(
                'type' => 'Zend\Mvc\Router\Http\Literal',
                'options' => array(
                    'route'    => '/',
                    'defaults' => array(
                        'controller' => 'Application\Controller\Index',
                        'action'     => 'index',
                    ),
                ),
            ),
            // The following is a route to simplify getting started creating
            // new controllers and actions without needing to create a new
            // module. Simply drop new controllers in, and you can access them
            // using the path /application/:controller/:action
            'application' => array(
                'type'    => 'Literal',
                'options' => array(
                    'route'    => '/application',
                    'defaults' => array(
                        '__NAMESPACE__' => 'Application\Controller',
                        'controller'    => 'Index',
                        'action'        => 'index',
                    ),
                ),
                'may_terminate' => true,
                'child_routes' => array(
                    'default' => array(
                        'type'    => 'Segment',
                        'options' => array(
                            'route'    => '/[:controller[/:action]]',
                            'constraints' => array(
                                'controller' => '[a-zA-Z][a-zA-Z0-9_-]*',
                                'action'     => '[a-zA-Z][a-zA-Z0-9_-]*',
                            ),
                            'defaults' => array(
                            ),
                        ),
                    ),
                ),
            ),
            'test-doctrine' => array(
                'type' => 'Zend\Mvc\Router\Http\Literal',
                'options' => array(
                    'route' => '/test-doctrine',
                    'defaults' => array(
                        'controller' => 'Application\Controller\TestDoctrine',
                        'action' => 'index',
                    ),
                ),
            ),
            'mentionsLegales' => array(
                'type'    => 'Literal',
                'options' => array(
                    'route'    => '/mentions-legales',
                    'defaults' => array(
                        '__NAMESPACE__' => 'Application\Controller',
                        'controller'    => 'MentionsLegales',
                        'action'        => 'index',
                    ),
                ),
            ),
            'cgv' => array(
                'type'    => 'Literal',
                'options' => array(
                    'route'    => '/cgv',
                    'defaults' => array(
                        '__NAMESPACE__' => 'Application\Controller',
                        'controller'    => 'Cgv',
                        'action'        => 'index',
                    ),
                ),
            ),
            'contact' => array(
                'type'    => 'Literal',
                'options' => array(
                    'route'    => '/demande-contact',
                    'defaults' => array(
                        '__NAMESPACE__' => 'Application\Controller',
                        'controller'    => 'Contact',
                        'action'        => 'index',
                    ),
                ),
            ),
            
            'returnContact' => array(
                'type'    => 'Literal',
                'options' => array(
                    'route'    => '/demande-contact',
                    'defaults' => array(
                        '__NAMESPACE__' => 'Application\Controller',
                        'controller'    => 'Contact',
                        'action'        => 'index',
                    ),
                ),
            ),
            'envoieMail' => array(// route de redirection sur la fonction sendMAil
                'type'    => 'Literal',
                'options' => array(
                    'route'    => '/sendMail',
                    'defaults' => array(
                        '__NAMESPACE__' => 'Application\Controller',
                        'controller'    => 'Contact',
                        'action'        => 'sendMail',
                    ),
                ),
            ),
            'moteurRecherche' => array(
                'type'    => 'Literal',
                'options' => array(
                    'route'    => '/moteur-recherche',
                    'defaults' => array(
                        '__NAMESPACE__' => 'Application\Controller',
                        'controller'    => 'MoteurRecherche',
                        'action'        => 'index',
                    ),
                ),
            ),
            'rechercher' => array(
                'type'    => 'Literal',
                'options' => array(
                    'route'    => '/rechercher',
                    'defaults' => array(
                        '__NAMESPACE__' => 'Application\Controller',
                        'controller'    => 'MoteurRecherche',
                        'action'        => 'rechercher',
                    ),
                ),
            ),
            'produit' => array(
                'type'    => 'Zend\Mvc\Router\Http\Segment',
                'options' => array(
                    'route'    => '/produit[/:action][/:id]',
                    'constraints' => array(
                        'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
                        'id'     => '[0-9]+',
                    ),
                    'defaults' => array(
                        'controller' => 'Application\Controller\Produit',
                        'action'     => 'index',
                    ),
                ),
            ),
            'search' => array(
                'type'    => 'Literal',
                'options' => array(
                    'route'    => '/search',
                    'defaults' => array(
                        '__NAMESPACE__' => 'Application\Controller',
                        'controller'    => 'Search',
                        'action'        => 'generateIndex',
                    ),
                ),
            ),
            'article' => array(
                'type'    => 'Zend\Mvc\Router\Http\Segment',
                'options' => array(
                    'route'    => '/article-[:id]',
                    'constraints' => array(
                    'id' => '[0-9]*'
                    ),
                    'defaults' => array(
                        '__NAMESPACE__' => 'Application\Controller',
                        'controller'    => 'Article',
                        'action'        => 'index',
                    ),
                ),
            ),
            'favoris' => array(
                'type'    => 'Literal',
                'options' => array(
                    'route'    => '/favoris',
                    'defaults' => array(
                        '__NAMESPACE__' => 'Application\Controller',
                        'controller'    => 'Favoris',
                        'action'        => 'index',
                    ),
                ),
            ),
            'message' => array(
                'type'    => 'Literal',
                'options' => array(
                    'route'    => '/message',
                    'defaults' => array(
                        '__NAMESPACE__' => 'Application\Controller',
                        'controller'    => 'Messages',
                        'action'        => 'index',
                    ),
                ),
            ),
            'parametre' => array(
                'type'    => 'Literal',
                'options' => array(
                    'route'    => '/parametre',
                    'defaults' => array(
                        '__NAMESPACE__' => 'Application\Controller',
                        'controller'    => 'Parametre',
                        'action'        => 'index',
                    ),
                ),
            ),
            'login' => array(
                'type'    => 'Literal',
                'options' => array(
                    'route'    => '/login',
                    'defaults' => array(
                        '__NAMESPACE__' => 'Application\Controller',
                        'controller'    => 'Login',
                        'action'        => 'index',
                    ),
                ),
            ),
            'register' => array(
                'type'    => 'Literal',
                'options' => array(
                    'route'    => '/register',
                    'defaults' => array(
                        '__NAMESPACE__' => 'Application\Controller',
                        'controller'    => 'Register',
                        'action'        => 'index',
                    ),
                ),
            ),
            'changeprofile' => array(
                'type'    => 'Literal',
                'options' => array(
                    'route'    => '/changeprofile',
                    'defaults' => array(
                        '__NAMESPACE__' => 'Application\Controller',
                        'controller'    => 'Profile',
                        'action'        => 'index',
                    ),
                ),
            ),
            'boutiqueFront' => array(
                'type'    => 'Zend\Mvc\Router\Http\Segment',
                'options' => array(
                    'route'    => '/boutique-[:id]',
                    'constraints' => array(
                    'id' => '[0-9]+'
                    ),
                    'defaults' => array(
                        '__NAMESPACE__' => 'Application\Controller',
                        'controller'    => 'Boutique',
                        'action'        => 'index',
                    ),
                ),
            ),
        ),
    ),
    'service_manager' => array(
        'abstract_factories' => array(
            'Zend\Cache\Service\StorageCacheAbstractServiceFactory',
            'Zend\Log\LoggerAbstractServiceFactory',
        ),
        'aliases' => array(
            'translator' => 'MvcTranslator',
        ),
    ),
    'translator' => array(
        'locale' => 'fr_FR',
        'translation_file_patterns' => array(
            array(
                'type'     => 'gettext',
                'base_dir' => __DIR__ . '/../language',
                'pattern'  => '%s.mo',
            ),
        ),
    ),
    'controllers' => array(
        'invokables' => array(
            'Application\Controller\Index' => 'Application\Controller\IndexController',
            'Application\Controller\TestDoctrine' => 'Application\Controller\TestDoctrineController',
            'Application\Controller\MentionsLegales' => 'Application\Controller\MentionsLegalesController',
            'Application\Controller\Contact' => 'Application\Controller\ContactController',
            'Application\Controller\Cgv' => 'Application\Controller\CgvController',
            'Application\Controller\MoteurRecherche' => 'Application\Controller\MoteurRechercheController',
            'Application\Controller\Produit' => 'Application\Controller\ProduitController',
            'Application\Controller\Article' => 'Application\Controller\ArticleController',        
            'Application\Controller\Favoris' => 'Application\Controller\FavorisController',
            'Application\Controller\Messages' => 'Application\Controller\MessagesController',
            'Application\Controller\Parametre' => 'Application\Controller\ParametreController',
            'Application\Controller\Login' => 'Application\Controller\LoginController',
            'Application\Controller\Register' => 'Application\Controller\RegisterController',
            'Application\Controller\Boutique' => 'Application\Controller\BoutiqueController',
            'Application\Controller\Profile' => 'Application\Controller\ProfileController',
        ),
    ),
    'view_manager' => array(
        'display_not_found_reason' => true,
        'display_exceptions'       => true,
        'doctype'                  => 'HTML5',
        'not_found_template'       => 'error/404',
        'exception_template'       => 'error/index',
        'template_map' => array(
            'layout/layout'           => __DIR__ . '/../view/layout/layout.phtml',
            'application/index/index' => __DIR__ . '/../view/application/index/index.phtml',
            'error/404'               => __DIR__ . '/../view/error/404.phtml',
            'error/index'             => __DIR__ . '/../view/error/index.phtml',
        ),
        'template_path_stack' => array(
            __DIR__ . '/../view',
        ),
    ),
    // Placeholder for console routes
    'console' => array(
        'router' => array(
            'routes' => array(
            ),
        ),
    ),
    // doctrine config    
	'doctrine' => array(
		'driver' => array(
			'my_annotation_driver' => array(
			    'class' => 'Doctrine\ORM\Mapping\Driver\AnnotationDriver',
			    'cache' => 'array',
			    'paths' => array('./module/Application/src/Application/Model/Entity'),
			),
			 'orm_default' => array(
			    'drivers' => array(
			        'Application\Model\Entity' => 'my_annotation_driver'
			    ),
			),
		),
	),
    // MODULE CONFIGURATIONS
    'module_config' => array(
        'search_index' => __DIR__ . '/../data/search_index'
    ),
);
